package com.x.erp.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.x.erp.dao.DetectionImageDao;
import com.x.erp.model.DetectionImage;
import com.x.framework.exception.BusinessException;
import com.x.framework.exception.ExceptionCode;
import com.x.framework.service.BaseService;

/**
 * 检测单图片服务
 */
@Component
public class DetectionImageService extends BaseService {

	@Autowired
	private DetectionImageDao detectionImageDao;//检测单图片DAO

	/**
	 * 新增检测单图片信息
	 * @param detectionImage
	 * @return
	 */
	public DetectionImage insertDetectionImage(DetectionImage detectionImage) {
		try{
			return this.insert(detectionImage);
		} catch (Exception e) {
			throw new BusinessException(ExceptionCode.EXCEPTION_CODE0000, e);
		}
	}

	/**
	 * 修改检测单图片信息
	 * @param detectionImage
	 * @return
	 */
	public int updateDetectionImage(DetectionImage detectionImage) {
		return this.update(detectionImage);
	}

	/**
	 * 查询检测单图片信息
	 * @param detectionImage
	 * @return
	 */
	public List<DetectionImage> selectDetectionImageList(DetectionImage detectionImage) {
		try{
			return detectionImageDao.selectDetectionImageList(detectionImage);
		} catch (Exception e) {
			throw new BusinessException(ExceptionCode.EXCEPTION_CODE0000, e);
		}
	}

}
